//package com.asset.salesforce.dao;
//
//import java.util.List;
//
//import org.hibernate.Query;
//import org.hibernate.Session;
//import org.hibernate.SessionFactory;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Repository;
//
//import com.asset.salesforce.domain.Rating;
//
//@Repository
//public class RatingDaoImpl {
//	@Autowired
//	SessionFactory sessionFactory;
//	
//	@SuppressWarnings("unchecked")
//	public Rating getRatingById(Integer id) {
//		 Session session = sessionFactory.getCurrentSession();
//		 Query query = session.createQuery("from Rating where id=  :id");
//		 query.setParameter("id", id);
//		 List<Rating>list =   query.list();
//		return list.get(0);
//	}
//	
//	@SuppressWarnings("unchecked")
//	public Rating getRatingByName(String name) {
//		 Session session = sessionFactory.getCurrentSession();
//		 Query query = session.createQuery("from Rating where name=  :name");
//		 query.setParameter("name", name);
//		 List<Rating>list =   query.list();
//		return list.get(0);
//	}
//	@SuppressWarnings("unchecked")
//	public List<Rating> getAllRating() {
//		 Session session = sessionFactory.getCurrentSession();
//		 Query query = session.createQuery("from Rating as r order by r.id ");
//	    return query.list();
//		 
//		
//	}
//
//}
